<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../css/public.css">
</head>

<body>
    <!-- shadowColor 设置或返回用于阴影的颜色-->
    <!-- shadowBlur 设置或返回用于阴影的模糊级别-->
    <!-- shadowOffsetX 设置或返回阴影距形状的水平距离-->
    <!-- shadowOffsetY 设置或返回阴影距形状的垂直距离-->

    <canvas id="myCanvas1" width="300" height="150" style="border:1px solid #d3d3d3;"></canvas>


    <script>
        var a = document.getElementById('myCanvas1');
        var atx = a.getContext('2d');
        atx.shadowBlur = 20;
        atx.shadowOffsetX = 20;
        atx.shadowOffsetY = 20;
        atx.shadowColor = "black";
        atx.fillStyle = "#ffac20";
        atx.fillRect(20, 20, 150, 100);
    </script>
</body>

</html>